﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Asomy.Model.Brushes
{
    class BrushHandler
    {       
        public List<Brush> m_brushes = new List<Brush>();

        private int m_chosenBrush = 0;

        private int m_brushID = 0;

        public int ChosenBrushID
        {
            get { return m_chosenBrush; }
            set
            {
                if (value > m_brushes.Count - 1)
                {
                    m_chosenBrush = m_brushes.Count - 1;
                }
                else if (value < 0)
                {
                    m_chosenBrush = 0;
                }
                else
                {
                    m_chosenBrush = value;
                }
            }
        }

        public BrushHandler()
        {
            AddBrush(new StandardBrush(m_brushID));            
        }

        public void AddBrush(Brush a_brush)
        {
            m_brushes.Add(a_brush);
            m_brushID++;
        }

        public Brush GetSelectedBrush()
        {
            return m_brushes[ChosenBrushID];
        }
        
    }
}
